package com.cooper.base.service;

import com.cooper.base.model.SysRole;
import com.cooper.common.core.db.QueryPage;
import com.cooper.common.core.service.BaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

/**
 * 角色Service
 */
@Service("com.cooper.base.service.SysRoleService")
public class SysRoleService extends BaseService<SysRole> {

    public PageInfo<SysRole> list(QueryPage page) {
        Example example = new Example(SysRole.class);
        example.createCriteria().andEqualTo("isDelete", false);
        PageHelper.startPage(page.getiDisplayStart(), page.getiDisplayLength());
        return new PageInfo<>(mapper.selectByExample(example));
    }
}
